package com.jamcodingnm.apps.abqevents.rss;

import java.util.ArrayList;
import java.util.List;

/**
 * Object to store RSS title and RSSItems
 * 
 * @author Marcos
 * 
 */
public class RSSFeed {
	private String title = null;
	private int itemcount = 0;
	private List<RSSItem> itemlist;

	protected RSSFeed() {
		itemlist = new ArrayList<RSSItem>();
	}

	protected int addItem(RSSItem item) {
		itemlist.add(item);
		itemcount++;
		return itemcount;
	}

	/**
	 * @param location
	 * @return the RSSItem in the given location
	 */
	public RSSItem getItem(int location) {
		return itemlist.get(location);
	}

	/**
	 * @return the title of the RSS feed
	 */
	protected String getTitle() {
		return title;
	}

	/**
	 * @return the number of RSSItems in the list
	 */
	protected int getItemcount() {
		return itemcount;
	}

	/**
	 * @return the list of RSSItems
	 */
	public List<RSSItem> getItemlist() {
		return itemlist;
	}

	protected void setTitle(String title) {
		this.title = title;
	}

	protected void setItemcount(int itemcount) {
		this.itemcount = itemcount;
	}

	protected void setItemlist(List<RSSItem> itemlist) {
		this.itemlist = itemlist;
	}
}